import { callService } from "./api";

export function generateBindCode() {
  return callService<{ bindCode: string; expiresAt: string }>("bindGenerateCode");
}

export function bindPartner(bindCode: string) {
  return callService<{ status: string }>("bindPartner", { bindCode });
}

export function fetchBindRequests() {
  return callService<{ requests: Array<{ bindCode: string; expiresAt: string; requesterNickname: string }> }>(
    "bindRequestList"
  );
}

export function confirmBind(bindCode: string) {
  return callService<{ dinerInfo: { nickname: string; avatarUrl: string } }>("bindConfirm", { bindCode });
}
